package cn.buk.tms.hotel.service;

import cn.buk.common.JsonResult;
import cn.buk.common.dto.CommonDto;
import cn.buk.tms.entity.misc.OperationLog;
import cn.buk.tms.dto.request.HotelOrderRequestDto;
import cn.buk.tms.dto.response.HotelOrderResponseDto;
import cn.buk.tms.hotel.sc.HotelOrderSearchCriteria;

import java.util.List;

/**
 * @author yfdai
 */
public interface HotelOrderService {

  /**
   * 查找酒店订单
   */
  List<HotelOrderResponseDto> searchHotelOrders(int enterpriseId, int userId, HotelOrderSearchCriteria sc);

  CommonDto<HotelOrderResponseDto> searchHotelOrders2(int enterpriseId, int userId, HotelOrderSearchCriteria sc);

  /**
   * 查找
   */
  HotelOrderResponseDto getHotelOrderById(int enterpriseId, int userId, int orderId);

  /**
   * 创建机票订单
   */
  JsonResult createHotelOrder(int enterpriseId, String username, HotelOrderRequestDto dto);

  /**
   * 修改订单备注
   */
  JsonResult updateHotelOrderRemark(int enterpriseId, String username, int orderId, String remark);

  /**
   * 修改酒店供应商
   */
  JsonResult updateHotelOrderSupplier(int enterpriseId, String username, int orderId, int supplierId);

  /**
   * 酒店酒店订单支付给供应商的付款方式
   */
  JsonResult updateHotelOrderPaymentMethod(int enterpriseId, String username, int orderId, int paymentMethodId);

  /**
   * 修改酒店订单的价格
   */
  JsonResult updateHotelOrderPrice(int enterpriseId, String username, int orderId, double price, double cost, double serviceCharge);

  /**
   * 提交酒店订单
   */
  JsonResult submitHotelOrder(int enterpriseId, String username, int orderId);

  /**
   * 审批通过订单
   */
  JsonResult approveHotelOrder(int enterpriseId, String username, int orderId, int denyCode, String denyReason);

  JsonResult processHotelOrder(int enterpriseId, String username, int orderId);

  /**
   * 完成酒店订单
   */
  JsonResult finishHotelOrder(int enterpriseId, String username, int orderId, String confirmNo);

  List<OperationLog> searchHotelOrderHistory(int enterpriseId, int orderId);

  /**
   * 取消酒店订单
   */
  JsonResult cancelHotelOrder(int enterpriseId, String username, int orderId, String remark);


  /**
   * 回滚酒店订单
   */
  JsonResult rollbackHotelOrder(int enterpriseId, String username, int orderId, final String remark);

  void autoAlertHotelOrderStatus();

  /**
   * 检查酒店订单的酒店是否可定
   */
  JsonResult checkSupplierHotelAvail(int enterpriseId, String username, int orderId);

  /**
   * 与代理通的订单详情同步
   */
  JsonResult syncSupplierHotelOrder(int enterpriseId, String username, int orderId);

  /**
   * 取消代理通的订单
   */
  JsonResult cancelSupplierHotelOrder(int enterpriseId, String username, int orderId);

  JsonResult createSupplierHotelOrder(int enterpriseId, String username, int orderId);


  /**
   * 检查需要分分配审批人的酒店订单
   */
  void checkHotelOrderNeedApprover(int ownerId, String agentName);

  /**
   * 检查需要校验底价的酒店订单
   */
  void checkHotelOrderPrice(int enterpriseId, String agentName);

  /**
   * 检查酒店订单是否符合企业差旅规定
   */
  void checkHotelOrderMeetPolicy(int enterpriseId, String agentName);

  /**
   * 检查酒店订单的城市ID信息
   */
  void checkHotelOrderCityId(int enterpriseId, String agentName);

  JsonResult updateHotelOrderChannel(int enterpriseId, String username, int orderId, int channel);

  void checkHotelOrderStatus(int enterpriseId, String username);

  void checkHotelOrderNotifyStatus(int enterpriseId, String username);
}
